﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Boss/BossMasterPage.master" AutoEventWireup="true" CodeFile="Query.aspx.cs" Inherits="Boss_Query" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="background-color:#f3f9eb;height:500px">
    <div style="margin: 0px auto; width: 100%; text-align:center;" >
            <div style="width: 43%; text-align:center;float:left" >
        
                <asp:Label ID="Label1" runat="server" Text="起始时间"></asp:Label>
                <asp:DropDownList ID="StartYearDrop" runat="server"></asp:DropDownList>年
                <asp:DropDownList ID="StartMonthDrop" runat="server"></asp:DropDownList>月
                <asp:DropDownList ID="StartDayDrop" runat="server"></asp:DropDownList>日
            </div>
            <div style="width: 43%; text-align:center;float:left" >
        
                <asp:Label ID="Label2" runat="server" Text="结束时间"></asp:Label>
                <asp:DropDownList ID="EndYearDrop" runat="server"></asp:DropDownList>年
                <asp:DropDownList ID="EndMonthDrop" runat="server"></asp:DropDownList>月
                <asp:DropDownList ID="EndDayDrop" runat="server"></asp:DropDownList>日
            </div>
 
            <div style="text-align:center;float:left" >      
                <asp:Button ID="SearchBut" runat="server" Text="查询" style="width:40px" OnClick="SearchBut_Click" />                
                <asp:Button ID="SearchAllBut" runat="server" Text="全部查询" style="width:70px;margin-left:10px" OnClick="SearchAllBut_Click" />
            </div>
            <div style=" clear:left ; text-align:center">
                <asp:Label ID="Label4" runat="server" Text="起始时间"></asp:Label>
                <asp:Label ID="StartTimeLab" runat="server" Text=""></asp:Label>
                <asp:Label ID="Label6" runat="server" Text="结束时间"></asp:Label>
                <asp:Label ID="EndTimeLab" runat="server" Text=""></asp:Label>
            </div>
        </div>
    <div style="text-align:center;clear:left">
        <asp:Label ID="Label3" runat="server" Text="营业额"></asp:Label>
        <asp:Label ID="SumLab" runat="server" Text="" style="margin-left:30px"></asp:Label>
        </div>
    <div style="text-align:center;margin:0 auto;width:100%;clear:left;padding-left:20%" >
        <div style="width:60%">
        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" style="margin:0 auto;text-align:center">
            <Columns>
                <asp:BoundField DataField="Dno" HeaderText="编号" SortExpression="Dno" />
                <asp:BoundField DataField="Dname" HeaderText="菜名" SortExpression="Dname" />
                <asp:BoundField DataField="Count" HeaderText="已售" ReadOnly="True" SortExpression="Count" />
            </Columns>
        </asp:GridView>
            </div>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=SUBAI-WORKSTATI;Initial Catalog=Restaurant;User ID=BOSS;Password=ss" ProviderName="System.Data.SqlClient" SelectCommand="SELECT Dno,Dname, SUM(Cnum) AS Count 
FROM Boss_Menu_Count 
WHERE (Ooktime &gt; @startTime  and Ooktime &lt;@endTime)
GROUP BY Dno,Dname">
            <SelectParameters>
                <asp:ControlParameter ControlID="StartTimeLab" DefaultValue="1900-01-01" Name="startTime" PropertyName="Text" />
                <asp:ControlParameter ControlID="EndTimeLab" DefaultValue="3000-01-01" Name="endTime" PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
        </div>
</asp:Content>

